*** Settings ***
Documentation  用户A发布话题,，用户B回复话题
Library    SeleniumLibrary

*** Variables ***
${username}     testuser1

*** test cases ***
#测试用例集
用户A登录并成功发布话题,，用户B登录并成功回复话题
    Open Browser    http://39.107.96.138:3000/  Chrome
    Maximize Browser Window
    Click Element   xpath://*[@href="/signin"]
    Input Text  //*[@id="name"]     microyl
    Input Text  //*[@id="pass"]     396639
    Click Element   xpath://*[@type="submit"]
    Click Element   //*[@class="span-success"]
    Click Element   //*[@id="tab-value"]
    Click Element   //*[@value="share"]
    Input Text    //*[@id="title"]     今天中午吃了回锅肉
    Click Element   xpath://*[@class="CodeMirror-scroll"]
    Press Keys      xpath://*[@class="CodeMirror-scroll"]   大家好，这是一个临时文件
    Click Element   xpath://*[@type="submit"]
    ${currentUrl}   Log Location
    Element Text Should Be      //*[@class="topic_full_title"]      今天中午吃了回锅肉
    Element Should Contain      //div[@class="changes"]/span[last()]    分享
    Element Should Contain      //div[@class="topic_content"]/div[@class="markdown-text"]   大家好，这是一个临时文件
    Close Window
    Open Browser    ${currentUrl}  Chrome
    Maximize Browser Window
    Click Element   xpath://*[@href="/signin"]
    Input Text  //*[@id="name"]     ${username}
    Input Text  //*[@id="pass"]     123456
    Click Element   xpath://*[@type="submit"]
    Press Keys      xpath://*[@class="CodeMirror-scroll"]   你咋个回事，咋这么笨呢？
    Click Element   xpath://*[@class="span-primary submit_btn"]
    Element Text Should Be     xpath://*[@class="reply_content from-${username}"]      你咋个回事，咋这么笨呢？
    Close Window



#*** keywords ***
